import React from "react";

class Fb extends React.Component {
    static defaultProps = {
        a:0,
        b:1
    };
    state = {
        list: [this.props.a,this.props.b],
    };
componentDidMount() {
    this.timer = setInterval(() =>{
        const [a,b]  = this.state.list.slice(-2);
        this.setState({list:[...this.state.list,a+b]})
    },1000)
}
componentWillUnmount() {
    clearInterval(this.timer)
}
    render() {
        return (
            <>
            {this.state.list.join()}
            </>
        )
    }
}
export default Fb;